package com.fjh.feign.hystrix;

import com.alibaba.fastjson.JSON;
import com.fjh.domain.Sku;
import com.fjh.feign.OrderProductFeign;
import com.fjh.model.StockChange;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Slf4j
public class OrderProductFeignHystrix implements OrderProductFeign {

    /**
     * 根据skuIds查询sku集合
     * @param skuIds
     * @return
     */
    @Override
    public List<Sku> getSkuListByIds(List<Long> skuIds) {
        log.error("根据skuIds查询sku集合失败，skuIds为{}", JSON.toJSONString(skuIds));
        return null;
    }

    /**
     *发起远程调用 修改mysql的库存
     * @param stockChange
     */
    @Override
    public void changeStock(StockChange stockChange) {
        log.error("发起远程调用 修改mysql的库存失败，数据为{}",JSON.toJSONString(stockChange));
    }
}
